package com.wwtech.epp.ui.adapter.main;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wwtech.epp.R;
import com.wwtech.epp.entity.WorkCategory;

import java.util.List;

/**
 * 作者：Android on 2017/8/28
 * 邮箱：365941593@qq.com
 * 描述：
 */

public class WorkCategoryItemAdapter extends BaseQuickAdapter<WorkCategory.DataBean.AppsBean, BaseViewHolder> {

    public WorkCategoryItemAdapter(@Nullable List<WorkCategory.DataBean.AppsBean> data) {
        super(R.layout.item_work_category_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, WorkCategory.DataBean.AppsBean appsBean) {
        helper.setText(R.id.textView2, appsBean.getAppName());
        ImageView imageView = helper.getView(R.id.imageView);
        Glide.with(mContext)
                .load(appsBean.getResourceUrl())
                .error(R.mipmap.mail_female)
                .into(imageView);
//        if (appsBean.getAppId() == 5 && ContainValue.userLogin.getData().getRoleLevel() > 1) {
//            helper.setVisible(R.id.root, false);
//        } else {
//            helper.setVisible(R.id.root, true);
//        }
    }
}
